package com.svse.designPattern.structure.flyweight.concreteflyweight;

import com.svse.designPattern.structure.flyweight.flyweight.Flyweight;
import com.svse.designPattern.structure.flyweight.unsharableflyweight.UnsharedConcreteFlyweight;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2020/8/2 9:22
 */
public class ConcreteFlyweight implements Flyweight {
    private String key;

    public ConcreteFlyweight(String key) {
        this.key = key;
        System.out.println("具体享元"+key+"被创建！");
    }
    @Override
    public void operation(UnsharedConcreteFlyweight state) {
        System.out.print("具体享元"+key+"被调用，");
        System.out.println("非享元信息是:"+state.getInfo());
    }
}
